<template>
  <el-config-provider :locale="locale" size="default" :button="buttonConfig">
    <router-view></router-view>
  </el-config-provider>
</template>

<script setup lang="ts">
import { onMounted, reactive, computed } from 'vue'
// import { useTheme } from '@/hooks/useTheme'
import { ElConfigProvider } from 'element-plus'
import { LanguageType } from './stores/interface'
import { useGlobalStore } from '@/stores/modules/global'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

const globalStore = useGlobalStore()

// init theme
// const { initTheme } = useTheme()
// initTheme()

// init language
onMounted(() => {
  const language = 'zh'
  globalStore.setGlobalState('language', language as LanguageType)
})

// element language
const locale = computed(() => zhCn)

// element button config
const buttonConfig = reactive({ autoInsertSpace: false })
</script>
